package main

import (
	"io"
	"log"
	"os"
	"os/signal"

	"gitee.com/awol2010ex/openfaas-gin-template/function"
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()

	gin.SetMode(gin.ReleaseMode)
	f, _ := os.Create("gin.log")
	gin.DefaultWriter = io.MultiWriter(f)

	//执行handler方法
	function.Handle(r)
	go func() {
		_ = r.Run(":9033")
	}()

	quit := make(chan os.Signal)
	signal.Notify(quit, os.Interrupt)
	<-quit
	log.Print("end function")
}
